package com.mhy.exam.mapper;

import com.mhy.exam.pojo.OrderItem;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface OrderItemMapper {
    Integer insert(OrderItem orderItem);

    @Select("select * from tb_order_item where id = #{id}")
    OrderItem select2(Integer id);

    @Insert("INSERT INTO tb_order_item values (null, #{goodsName}, #{goodsPrice}, #{count}, #{orderId})")
    void insert2(OrderItem orderItem);

    @Delete("delete from tb_order_item where id = #{id}")
    void delete2(Integer id);

    @Update("update tb_order_item set goods_name = #{goodsName}, goods_price = #{goodsPrice}, count = #{count}, order_id = #{orderId} where id = #{id}")
    void update2(OrderItem orderItem);
}
